import java.util.*;
import javax.swing.*;

public class GuessNumberOneTime {
    public static void main(String[] args){
        int number = (int)(Math.random() * 101);
        int guess = -1;
        Scanner scanner = new Scanner(System.in);
        System.out.println("Uzmini maģisko skaitli no 0 līdz 100!");
        
        while (guess != number){
            System.out.print("\nIevadi minējumu: ");
            guess = scanner.nextInt();
            if(guess == number)
                JOptionPane.showMessageDialog(null, "Uzminēji! Balvā - ne pirmā svaiguma baranka.");
            else if(guess > number)
                JOptionPane.showMessageDialog(null, "Neuzminēji! Zemāk!");
            else
                JOptionPane.showMessageDialog(null, "Neuzminēji! Augstāk!");
        }
        
    }
}